import plugin from './plugin';

import InputModal from './input';

import ButtonModal from './button';

export { InputModal, ButtonModal };

// 注册表格渲染
export const registerRenderTableCell = (pluginName: string, callback: Function) => {
  plugin.renderTableCellRegister(pluginName, callback);
};

// 注册表格用户选中后数据转换
export const registerTableSelectValue = (pluginName: string, callback: Function) => {
  plugin.tableSelectedRowsRegister(pluginName, callback);
};

// 注册用户搜索参数转换
export const registerConvertSearchParams = (pluginName: string, callback: Function) => {
  plugin.convertSearchParamsRegister(pluginName, callback);
};

// 注册搜索结果数据转换
export const registerConvertDataSource = (pluginName: string, callback: Function) => {
  plugin.convertDataSourceRegister(pluginName, callback);
};

// 注册回显
export const registerConvertDisplayValue = (pluginName: string, callback: Function) => {
  plugin.convertDisplayValueRegister(pluginName, callback);
};

// 表格每一行props
export const registerTableCheckboxRowProps = (pluginName: string, callback: Function) => {
  plugin.tableCheckboxRowPropsRegister(pluginName, callback);
};

// 注册表格选中并确定之后数据转换
export const registerConvertTableSelectedRows = (pluginName: string, callback: Function) => {
  plugin.convertTableSelectedRowsRegister(pluginName, callback);
};

// 注册提交参数转换
export const registerConvertSubmitParams = (pluginName: string, callback: Function) => {
  plugin.convertSubmitParamsValueRegister(pluginName, callback);
};

// 详情页数据转换
export const registerConvertDetailValues = (pluginName: string, callback: Function) => {
  plugin.convertDetailValuesRegister(pluginName, callback);
};
